<?php
//等级模型
namespace Mobile\Model;
use Think\Model;

/**
 * 用户模型
 */
class gradeModel extends Model{
    
    protected $tableName = 'grade';

    /**
     * 自动完成
     * @var array
     */
    protected $_auto = array(
    );
    

    /*
     * 自动验证
     */
    protected $_validate = array(
     );
    
    /*
     * 获取列表
     */
    public function getGradeList($where){
        $where = array(
            "status" => 1
        );
        $res = $this->where($where)->order('ord ASC')->select();
        return $res;
    }
	
    /*
     * 统计数量
     */
    public function getGradeCount($where){
        $res = $this->where($where)->count();
        return $res;
    }
    
    /*
     * 添加
     */
    public function addGrade($data){
        $res = $this->add($data);
        return $res;
    }
    
    /*
     * 获取信息
     */
    public function getGrade($where){
        $res = $this->where($where)->find();
        return $res;
    }
	
    /*
     * 编辑信息
     */
    public function editGrade($where,$data){
        return $this->where($where)->save($data);
    }
    
    
}
